Research
Security News
Malicious npm Packages Inject SSH Backdoors via Typosquatted Libraries
Socket’s threat research team has detected six malicious npm packages typosquatting popular libraries to insert SSH backdoors.
The 'unpipe' npm package is designed to remove or detach a stream from a pipeline. This can be particularly useful in scenarios where you need to gracefully handle stream errors or manipulate the flow of data dynamically. It provides a straightforward API to unpipe streams, which can be beneficial in creating more robust and error-resilient streaming applications.
Unpipe a stream
This code demonstrates how to use 'unpipe' to detach a stream when an error occurs. It's useful for preventing memory leaks or unintended data processing after an error.
const unpipe = require('unpipe');
const stream = getSomeReadableStream();
stream.on('error', function(err) {
unpipe(stream);
});
The 'pump' package is similar to 'unpipe' in that it is used to safely pipe streams together, handling cleanup and errors gracefully. Unlike 'unpipe', which is focused on detaching streams, 'pump' provides a more comprehensive solution for creating and managing stream pipelines, including the ability to safely clean up after streams have ended or errored.
While 'through2' is not directly similar to 'unpipe' in functionality, it offers a simplified wrapper around Node's stream.Transform. It's useful for creating transform streams easily. In comparison, 'unpipe' specifically deals with detaching streams, whereas 'through2' is more about stream creation and transformation.
Unpipe a stream from all destinations.
$ npm install unpipe
var unpipe = require('unpipe')
Unpipes all destinations from a given stream. With stream 2+, this is
equivalent to stream.unpipe()
. When used with streams 1 style streams
(typically Node.js 0.8 and below), this module attempts to undo the
actions done in stream.pipe(dest)
.
FAQs
Unpipe a stream from all destinations
The npm package unpipe receives a total of 23,306,436 weekly downloads. As such, unpipe popularity was classified as popular.
We found that unpipe demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Research
Security News
Socket’s threat research team has detected six malicious npm packages typosquatting popular libraries to insert SSH backdoors.
Security News
MITRE's 2024 CWE Top 25 highlights critical software vulnerabilities like XSS, SQL Injection, and CSRF, reflecting shifts due to a refined ranking methodology.
Security News
In this segment of the Risky Business podcast, Feross Aboukhadijeh and Patrick Gray discuss the challenges of tracking malware discovered in open source softare.